UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h3ff5faSacppArnIXKCjs71z+o52y0/LYPYuhH+j0Xo='
WHERE
key_id = 'd37b893081747d7592c95496175e4517214e7c5fcf76faa8d56710ebc411a047'
AND (
token = 'h3ff5faSacppArnIXKCjs71z+o52y0/LYPYuhH+j0Xo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)