UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8Rf49V9zw2iUXSu2BIN5Nuax5s6gPMrjWqqaRHYlyRA='
WHERE
key_id = '734a5a6c8134f232445f7a303af1f396d8f940cda96447ad459fa8b0fcd3e882'
AND (
token = '8Rf49V9zw2iUXSu2BIN5Nuax5s6gPMrjWqqaRHYlyRA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)