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