UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GR0XSK7/oVherZfe42pyzJPhuqmDDWqu8UaDNrYtuio='
WHERE
key_id = 'ad3aacd4c821ea4123b23a1d8f2508c976c9ea8cdad306e9920612063813b2d9'
AND (
token = 'GR0XSK7/oVherZfe42pyzJPhuqmDDWqu8UaDNrYtuio='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)