UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oB44znePQlLf0v8MCA5QVD85XLUZ9vPTFLIiaCW8xOE=' 
WHERE 
  key_id = 'acb328e0dac9b087d700c0c97d20c06a20bed5a768e24414e1c3e759c2b870f2' 
  AND (
    token = 'oB44znePQlLf0v8MCA5QVD85XLUZ9vPTFLIiaCW8xOE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034