UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5q4IhykZHo4XDG+Sg+TpkU4nXEciN2TaIstHfvzc0eE='
WHERE
key_id = 'e8da838d53c79f4b160f3c265e38d38b3ad2e5ac8a40c282763555c4797c5f51'
AND (
token = '5q4IhykZHo4XDG+Sg+TpkU4nXEciN2TaIstHfvzc0eE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)