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

Query time 0.00039