UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AY5BhYwjBXKRHuZ1ZRWoeryfutz9vGgCllWO3IcEekE=' 
WHERE 
  key_id = '753354f3b0574e41656c6b7449c207855e01ac6dce5588018ddd0b3f5fd969f9' 
  AND (
    token = 'AY5BhYwjBXKRHuZ1ZRWoeryfutz9vGgCllWO3IcEekE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032