UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '88YsB7DinNdEoyghGwkOtAbL3Wsto/XsZGfE7upF9p8='
WHERE
key_id = '8ef59fdb7905be3a7da4077bf032753f02387f687cc98b3d98d219cda9432e33'
AND (
token = '88YsB7DinNdEoyghGwkOtAbL3Wsto/XsZGfE7upF9p8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)