UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EawErZJEarP59HszvRrbshld4uXkyX22pC5/gb9ctOA='
WHERE
key_id = '4f76a21c35127bfd2cadce75b793a490743e106ee7f1155792fdf4e259244f70'
AND (
token = 'EawErZJEarP59HszvRrbshld4uXkyX22pC5/gb9ctOA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)