UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fjYrdkaqmigrZO7RuiruSw1rm5MDlsVBlyQHcR7kSko='
WHERE
key_id = '4339f432963ca242713f0da3f378f8aed179cfeb91d59b83403f2fd755bf9072'
AND (
token = 'fjYrdkaqmigrZO7RuiruSw1rm5MDlsVBlyQHcR7kSko='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)