UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yGCQ+Asu5wU+a6hUP1y+P1wZLZ+LVPgEOAj+V4FmonE='
WHERE
key_id = 'ce0ed5b70f6f42e6d52fcb803659bfa6b30ee01dbf42f97a74c335552d3f6b3f'
AND (
token = 'yGCQ+Asu5wU+a6hUP1y+P1wZLZ+LVPgEOAj+V4FmonE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)