UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FX1zrIEU7v6r+QjFX1pqQrok+fCu7HOzC9KUk6Rdq1o='
WHERE
key_id = '421327a1db9e2d3efbdc501e4750c00785897c9a3352732146a8f35aff419720'
AND (
token = 'FX1zrIEU7v6r+QjFX1pqQrok+fCu7HOzC9KUk6Rdq1o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)