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