UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ezJjL1aoUf2RNN7HUtO1cLGEy4iVSkkb2zSVVtO4nlE='
WHERE
key_id = '277af7e520591ec8d973103f0924ea5aaed0846d5415d6c72dbd6ee1790762a1'
AND (
token = 'ezJjL1aoUf2RNN7HUtO1cLGEy4iVSkkb2zSVVtO4nlE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)