UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eWeGcyQGHwOWNRuTk3SVcNcKw2Y+t11foctjB+0Jx60='
WHERE
key_id = '598235c7f724fb98ae56641ad09b2ff08fc267150918d9e3a5f17bf2de3967ee'
AND (
token = 'eWeGcyQGHwOWNRuTk3SVcNcKw2Y+t11foctjB+0Jx60='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)