UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G38QC6mstkmMfkNIjWtvKqqOrG3/CYyvSGvvVZUTJi0='
WHERE
key_id = '0b77363ad9e208c323fc6a1f7cae573d8084d8a60a2ebc72bb78d8850e03535c'
AND (
token = 'G38QC6mstkmMfkNIjWtvKqqOrG3/CYyvSGvvVZUTJi0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)