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