UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uJEA1HvZqJBbm71cRIxh+Li6EPHEDyncBCsoi5stX9o='
WHERE
key_id = 'e42c61e6f9dbf8db9c8895a63a3eaa31b5e873ffb38a360119d33f134e5c0454'
AND (
token = 'uJEA1HvZqJBbm71cRIxh+Li6EPHEDyncBCsoi5stX9o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)