UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BZHBmi492c4/bp5aWmUXNjlcQomcDKrxcTEgje87JLc='
WHERE
key_id = '6e67557da1b53c3d77633c884386517f322b0caa6e8733d181d88e85018c3c6d'
AND (
token = 'BZHBmi492c4/bp5aWmUXNjlcQomcDKrxcTEgje87JLc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)