UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BtUb8Iu+q0uqPFPwXNPaTPXt9uknBSbiilLk2bLnOJI='
WHERE
key_id = 'e05d67ef54ce78c78a29bc444a9811895173e982064b98fb2c8c915692421a74'
AND (
token = 'BtUb8Iu+q0uqPFPwXNPaTPXt9uknBSbiilLk2bLnOJI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)