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