UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h2X3Yb3HULAQyvFnEiurwjIHUCK2ZnTwwTQRQjCQiOM='
WHERE
key_id = 'ceddb5126c6cf0a3a1356557c70c2f17000417b22335f379badc552c58a26e0b'
AND (
token = 'h2X3Yb3HULAQyvFnEiurwjIHUCK2ZnTwwTQRQjCQiOM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)