UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LevkY0meSQVxi5d1TP81p2xeYFHxVBwwo+0RllxsOi0='
WHERE
key_id = 'eb13afdd2777daaaa49d23c5d6da2a338b6ed3e855abc3667bf414e1c45396f5'
AND (
token = 'LevkY0meSQVxi5d1TP81p2xeYFHxVBwwo+0RllxsOi0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)