UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c6Cgcx22yt5WwBSXvVBRFVEdg1coXCsxUy6zisi0/Gc='
WHERE
key_id = 'e4fce0cb342fbf611af58ca4bf027ed28f14f1dd134b8ef3a9d51311b005382f'
AND (
token = 'c6Cgcx22yt5WwBSXvVBRFVEdg1coXCsxUy6zisi0/Gc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)